#!/usr/bin/env python
# encoding: utf-8

'''
Game.py

Copyright (c) 2007, Adrian Petrescu

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.
    * The names of its contributors may not be used to endorse or promote
      products derived from this software without specific prior written
      permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
'''

from Growl import Image

GO_ICON_PATH = "../data/icons/go.icns"
CHESS_ICON_PATH = "../data/icons/chess.icns"

class Game:
   player_color = ""
   opponent_name = ""
   last_move = ""
   game_id = ""
   notifier = ""
   def getName(self): return "Game"
   def getPlayerColor(self): return self.player_color
   def getOpponentName(self): return self.opponent_name
   def getLastMove(self): return self.last_move
   def getGameID(self): return self.game_id
   def getNotifier(self): return self.notifier
   def getIcon(self): return None
   def __init__(self, notifier, game_id, opponent_name, player_color, last_move):
      self.notifier = notifier
      self.game_id = game_id
      self.opponent_name = opponent_name
      self.player_color = player_color
      self.last_move = last_move
   
class GoGame(Game):
   icon = Image.imageFromPath(GO_ICON_PATH)
   def getName(self): return "Go"
   def getIcon(self): return GoGame.icon
   

class ChessGame(Game):
   icon = Image.imageFromPath(CHESS_ICON_PATH)
   def getName(self): return "Chess"
   def getIcon(self): return ChessGame.icon